from django.db import models

# Create your models here.

from managerApp.models import User



class WeatherInfo(models.Model):
    id = models.AutoField("id", primary_key=True)
    averageHeight = models.CharField("averageHeight", max_length=255, default='')
    averageSmall = models.CharField("月平均低温", max_length=255, default='')
    mastHeight = models.CharField("月极端高温", max_length=255, default='')
    mastSmall = models.CharField("月极端低温", max_length=255, default='')
    averageAir = models.CharField("平均空气质量", max_length=255, default='')
    mastAir = models.CharField("最高空气质量", max_length=255, default='')
    lostAir = models.CharField("最低空气质量", max_length=255, default='')
    date = models.DateField("日期", max_length=255, default='')
    weekDay = models.CharField("星期", max_length=255, default='')
    mastHeightDay = models.CharField("日高温", max_length=255, default='')
    mastSmallDay = models.CharField("日低温", max_length=255, default='')
    wearther = models.CharField("天气", max_length=255, default='')
    wind = models.CharField("风向", max_length=255, default='')
    windlevel = models.CharField("风力", max_length=255, default='')
    city = models.CharField("城市", max_length=255, default='')

    class Meta:
        db_table = "weather_data"


class Part1(models.Model):
    id = models.AutoField("id", primary_key=True)
    max_temperature = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    min_temperature = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    city = models.CharField(max_length=100, null=True, blank=True)
    weather_date = models.DateField(null=True, blank=True)

    class Meta:
        db_table = 'max_min_temperature'  # 指定数据库中的表名


class Part2(models.Model):
    id = models.AutoField("id", primary_key=True)
    avg_high_temperature = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    avg_low_temperature = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    city = models.CharField(max_length=100, null=True, blank=True)
    weather_date = models.DateField(null=True, blank=True)

    class Meta:
        db_table = 'avg_temperature'  # 指定数据库中的表名


class Part3(models.Model):
    # id field is automatically created by Django as the primary key
    mastAir = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    lostAir = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    city = models.CharField(max_length=100, null=True, blank=True)
    weather_date = models.DateField(null=True, blank=True)

    class Meta:
        db_table = 'air_quality'
#
#
class Part4(models.Model):
    # id field is automatically created by Django as the primary key
    averageAir = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
    city = models.CharField(max_length=100, null=True, blank=True)
    weather_date = models.DateField(null=True, blank=True)

    class Meta:
        db_table = 'avg_air'  # Specify the database table name
#
#
# class Part5(models.Model):
#     # id field is automatically created by Django as the primary key
#     wind_level = models.CharField(max_length=10, null=True, blank=True)
#     city = models.CharField(max_length=100, null=True, blank=True)
#     weather_date = models.DateField(null=True, blank=True)
#
#     class Meta:
#         db_table = 'wind_info'  # Specify the database table name


